package zhao.lulu.contorller;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import zhao.lulu.service.GoodsService;

@RestController
public class BuyController {
    @Autowired
    @Qualifier("goodsService")
//    @Qualifier("goodsLockService")
//    @Qualifier("goodsSyncService")
//    @Qualifier("goodsRedissionLockSerivice")
//    @Qualifier("goodsZkService")
    GoodsService goodsService;


    @RequestMapping("buy/{goodsId}/{num}")
    public boolean buy(@PathVariable String goodsId,@PathVariable int num){
        String userId = "001";
        boolean buy = goodsService.buy(userId, goodsId, num);
        return buy;
    }
}
